package com.fz.entity;

import com.fz.core.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * <p>
 * 存储话题信息
 * </p>
 *
 * @author hyr
 * @since 2025-06-18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Topic extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    private LocalDateTime updateTime;

    /**
     * 发布用户ID（外键）
     */
    private Long userId;

    /**
     * 话题标题
     */
    private String title;

    /**
     * 话题内容
     */
    private String content;

    /**
     * 点赞数
     */
    private Integer likecount;

    /**
     * 逻辑删除（1=删除）
     */
    private Integer isDeleted;

    public Topic(Long userId, String title, String content) {

        this.userId = userId;
        this.title=title;
        this.content=content;
        this.createTime=LocalDateTime.now();
        this.updateTime=LocalDateTime.now();
        this.isDeleted=0;
        this.likecount=0;
    }

}
